package org.study.springboot.exception.handler.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.study.springboot.exception.handler.constant.Status;

/**
 * @author fangyu
 * @version v1.0.0
 * @date 2020/11/18 11:21 上午
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class BaseException extends RuntimeException{
    private Integer code;
    private String message;

    public BaseException(Status status) {
        super(status.getMessage());
        this.code = status.getCode();
        this.message = status.getMessage();
    }

    public BaseException(Integer code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }
}
